package com.systop.asset.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.systop.asset.mapper.MaterialRepositoryMapper;
import com.systop.asset.entity.MaterialRepository;
import com.systop.asset.service.IMaterialRepositoryService;

/**
 * 耗材仓库Service业务层处理
 * 
 * @author mc
 * @date 2025-06-26
 */
@Service
public class MaterialRepositoryServiceImpl implements IMaterialRepositoryService 
{
    @Autowired
    private MaterialRepositoryMapper materialRepositoryMapper;

    /**
     * 查询耗材仓库
     * 
     * @param id 耗材仓库主键
     * @return 耗材仓库
     */
    @Override
    public MaterialRepository selectMaterialRepositoryById(Long id)
    {
        return materialRepositoryMapper.selectMaterialRepositoryById(id);
    }

    /**
     * 查询耗材仓库列表
     * 
     * @param materialRepository 耗材仓库
     * @return 耗材仓库
     */
    @Override
    public List<MaterialRepository> selectMaterialRepositoryList(MaterialRepository materialRepository)
    {
        return materialRepositoryMapper.selectMaterialRepositoryList(materialRepository);
    }

    /**
     * 新增耗材仓库
     * 
     * @param materialRepository 耗材仓库
     * @return 结果
     */
    @Override
    public int insertMaterialRepository(MaterialRepository materialRepository)
    {
        return materialRepositoryMapper.insertMaterialRepository(materialRepository);
    }

    /**
     * 修改耗材仓库
     * 
     * @param materialRepository 耗材仓库
     * @return 结果
     */
    @Override
    public int updateMaterialRepository(MaterialRepository materialRepository)
    {
        return materialRepositoryMapper.updateMaterialRepository(materialRepository);
    }

    /**
     * 批量删除耗材仓库
     * 
     * @param ids 需要删除的耗材仓库主键
     * @return 结果
     */
    @Override
    public int deleteMaterialRepositoryByIds(Long[] ids)
    {
        return materialRepositoryMapper.deleteMaterialRepositoryByIds(ids);
    }

    /**
     * 删除耗材仓库信息
     * 
     * @param id 耗材仓库主键
     * @return 结果
     */
    @Override
    public int deleteMaterialRepositoryById(Long id)
    {
        return materialRepositoryMapper.deleteMaterialRepositoryById(id);
    }

    /**
     * 查询所有耗材仓库
     * @param materialRepository
     * @return
     */
    @Override
    public List<MaterialRepository> getRepository(MaterialRepository materialRepository) {
        return materialRepositoryMapper.selectMaterialRepositoryList(materialRepository);
    }
}